package com.yingside.jdk8new;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MyFrame extends JFrame {

    private JButton btn;
    public MyFrame(){
        this.setTitle("界面");
        this.setBounds(100,100,400,400);
        this.setLayout(new FlowLayout());

        btn = new JButton("确定");

        //btn.addActionListener(e -> System.out.println("hello,你好"));

        btn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {

            }
        });

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        this.add(btn);
    }

    public static void main(String[] args) {
        MyFrame myFrame = new MyFrame();
        myFrame.setVisible(true);
    }
}
